Skip to content

Add Apple Silicon support#2

Merged
Aero-Ex merged 5 commits intoAero-Ex:mainfrom
trK54Ylmz:main
Apr 27, 2026
Merged

Add Apple Silicon support#2
Aero-Ex merged 5 commits intoAero-Ex:mainfrom
trK54Ylmz:main

Conversation

@trK54Ylmz
Copy link
Copy Markdown

@trK54Ylmz trK54Ylmz commented Apr 24, 2026

This PR intends to add Apple Silicon support.

Which features are tested?

  • Generate without constraints
  • Generate with constraints
  • Export model

What are the results of these changes?

1. Add Apple Silicon support to Motion correction

$ python setup.py bdist_wheel
running bdist_wheel
running build
running build_py
creating build/lib.macosx-26.0-arm64-cpython-313/motion_correction
copying python/motion_correction/__init__.py -> build/lib.macosx-26.0-arm64-cpython-313/motion_correction
copying python/motion_correction/motion_postprocess.py -> build/lib.macosx-26.0-arm64-cpython-313/motion_correction
running build_ext
-- The C compiler identification is AppleClang 17.0.0.17000603
-- The CXX compiler identification is AppleClang 17.0.0.17000603
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- pybind11 not found, fetching from GitHub...
CMake Deprecation Warning at build/temp.macosx-26.0-arm64-cpython-313/_deps/pybind11-src/CMakeLists.txt:8 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


-- pybind11 v2.11.1
CMake Warning (dev) at build/temp.macosx-26.0-arm64-cpython-313/_deps/pybind11-src/tools/FindPythonLibsNew.cmake:98 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  build/temp.macosx-26.0-arm64-cpython-313/_deps/pybind11-src/tools/pybind11Tools.cmake:50 (find_package)
  build/temp.macosx-26.0-arm64-cpython-313/_deps/pybind11-src/tools/pybind11Common.cmake:188 (include)
  build/temp.macosx-26.0-arm64-cpython-313/_deps/pybind11-src/CMakeLists.txt:210 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonInterp: /Users/tarik/External/python/kimodo/.venv/bin/python (found suitable version "3.13.13", minimum required is "3.6")
-- Found PythonLibs: /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/lib/libpython3.13.dylib
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Performing Test HAS_FLTO_THIN
-- Performing Test HAS_FLTO_THIN - Success
-- Eigen3 not found, fetching from GitLab...
CMake Deprecation Warning at build/temp.macosx-26.0-arm64-cpython-313/_deps/eigen-src/CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


-- Performing Test EIGEN_COMPILER_SUPPORT_CPP11
-- Performing Test EIGEN_COMPILER_SUPPORT_CPP11 - Success
-- Performing Test COMPILER_SUPPORT_std=cpp03
-- Performing Test COMPILER_SUPPORT_std=cpp03 - Success
-- Performing Test standard_math_library_linked_to_automatically
-- Performing Test standard_math_library_linked_to_automatically - Success
-- Standard libraries to link to explicitly: none
-- Performing Test COMPILER_SUPPORT_WERROR
-- Performing Test COMPILER_SUPPORT_WERROR - Success
-- Performing Test COMPILER_SUPPORT_pedantic
-- Performing Test COMPILER_SUPPORT_pedantic - Success
-- Performing Test COMPILER_SUPPORT_Wall
-- Performing Test COMPILER_SUPPORT_Wall - Success
-- Performing Test COMPILER_SUPPORT_Wextra
-- Performing Test COMPILER_SUPPORT_Wextra - Success
-- Performing Test COMPILER_SUPPORT_Wundef
-- Performing Test COMPILER_SUPPORT_Wundef - Success
-- Performing Test COMPILER_SUPPORT_Wcastalign
-- Performing Test COMPILER_SUPPORT_Wcastalign - Success
-- Performing Test COMPILER_SUPPORT_Wcharsubscripts
-- Performing Test COMPILER_SUPPORT_Wcharsubscripts - Success
-- Performing Test COMPILER_SUPPORT_Wnonvirtualdtor
-- Performing Test COMPILER_SUPPORT_Wnonvirtualdtor - Success
-- Performing Test COMPILER_SUPPORT_Wunusedlocaltypedefs
-- Performing Test COMPILER_SUPPORT_Wunusedlocaltypedefs - Success
-- Performing Test COMPILER_SUPPORT_Wpointerarith
-- Performing Test COMPILER_SUPPORT_Wpointerarith - Success
-- Performing Test COMPILER_SUPPORT_Wwritestrings
-- Performing Test COMPILER_SUPPORT_Wwritestrings - Success
-- Performing Test COMPILER_SUPPORT_Wformatsecurity
-- Performing Test COMPILER_SUPPORT_Wformatsecurity - Success
-- Performing Test COMPILER_SUPPORT_Wshorten64to32
-- Performing Test COMPILER_SUPPORT_Wshorten64to32 - Success
-- Performing Test COMPILER_SUPPORT_Wlogicalop
-- Performing Test COMPILER_SUPPORT_Wlogicalop - Failed
-- Performing Test COMPILER_SUPPORT_Wenumconversion
-- Performing Test COMPILER_SUPPORT_Wenumconversion - Success
-- Performing Test COMPILER_SUPPORT_Wcpp11extensions
-- Performing Test COMPILER_SUPPORT_Wcpp11extensions - Success
-- Performing Test COMPILER_SUPPORT_Wdoublepromotion
-- Performing Test COMPILER_SUPPORT_Wdoublepromotion - Success
-- Performing Test COMPILER_SUPPORT_Wshadow
-- Performing Test COMPILER_SUPPORT_Wshadow - Success
-- Performing Test COMPILER_SUPPORT_Wnopsabi
-- Performing Test COMPILER_SUPPORT_Wnopsabi - Success
-- Performing Test COMPILER_SUPPORT_Wnovariadicmacros
-- Performing Test COMPILER_SUPPORT_Wnovariadicmacros - Success
-- Performing Test COMPILER_SUPPORT_Wnolonglong
-- Performing Test COMPILER_SUPPORT_Wnolonglong - Success
-- Performing Test COMPILER_SUPPORT_fnochecknew
-- Performing Test COMPILER_SUPPORT_fnochecknew - Success
-- Performing Test COMPILER_SUPPORT_fnocommon
-- Performing Test COMPILER_SUPPORT_fnocommon - Failed
-- Performing Test COMPILER_SUPPORT_fstrictaliasing
-- Performing Test COMPILER_SUPPORT_fstrictaliasing - Failed
-- Performing Test COMPILER_SUPPORT_wd981
-- Performing Test COMPILER_SUPPORT_wd981 - Failed
-- Performing Test COMPILER_SUPPORT_wd2304
-- Performing Test COMPILER_SUPPORT_wd2304 - Failed
-- Performing Test COMPILER_SUPPORT_STRICTANSI
-- Performing Test COMPILER_SUPPORT_STRICTANSI - Failed
-- Performing Test COMPILER_SUPPORT_Qunusedarguments
-- Performing Test COMPILER_SUPPORT_Qunusedarguments - Failed
-- Performing Test COMPILER_SUPPORT_ansi
-- Performing Test COMPILER_SUPPORT_ansi - Failed
-- Performing Test COMPILER_SUPPORT_OPENMP
-- Performing Test COMPILER_SUPPORT_OPENMP - Failed
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - /opt/homebrew/bin/gfortran
-- The Fortran compiler identification is GNU 15.2.0
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /opt/homebrew/bin/gfortran - skipped
-- Found unsuitable Qt version "6.11.0" from /opt/homebrew/bin/qmake
-- Qt4 not found, so disabling the mandelbrot and opengl demos
-- Could NOT find CHOLMOD (missing: CHOLMOD_INCLUDES CHOLMOD_LIBRARIES)
-- Could NOT find UMFPACK (missing: UMFPACK_INCLUDES UMFPACK_LIBRARIES)
-- Could NOT find KLU (missing: KLU_INCLUDES KLU_LIBRARIES)
-- Could NOT find SuperLU (missing: SUPERLU_INCLUDES SUPERLU_LIBRARIES SUPERLU_VERSION_OK) (Required is at least version "4.0")
-- Checking for one of the modules 'hwloc'
-- Performing Test HAVE_HWLOC_PARENT_MEMBER
-- Performing Test HAVE_HWLOC_PARENT_MEMBER - Success
-- Performing Test HAVE_HWLOC_CACHE_ATTR
-- Performing Test HAVE_HWLOC_CACHE_ATTR - Success
-- Performing Test HAVE_HWLOC_OBJ_PU
-- Performing Test HAVE_HWLOC_OBJ_PU - Success
-- Looking for hwloc_bitmap_free in hwloc
-- Looking for hwloc_bitmap_free in hwloc - not found
-- A version of Pastix has been found but pastix_nompi.h does not exist in the include directory. Because Eigen tests require a version without MPI, we disable the Pastix backend.
--
-- Configured Eigen 3.4.0
--
-- Available targets (use: make TARGET):
-- ---------+--------------------------------------------------------------
-- Target   |   Description
-- ---------+--------------------------------------------------------------
-- install  | Install Eigen. Headers will be installed to:
--          |     <CMAKE_INSTALL_PREFIX>/<INCLUDE_INSTALL_DIR>
--          |   Using the following values:
--          |     CMAKE_INSTALL_PREFIX: /usr/local
--          |     INCLUDE_INSTALL_DIR:  include/eigen3
--          |   Change the install location of Eigen headers using:
--          |     cmake . -DCMAKE_INSTALL_PREFIX=yourprefix
--          |   Or:
--          |     cmake . -DINCLUDE_INSTALL_DIR=yourdir
-- doc      | Generate the API documentation, requires Doxygen & LaTeX
-- blas     | Build BLAS library (not the same thing as Eigen)
-- uninstall| Remove files installed by the install target
-- ---------+--------------------------------------------------------------
--
-- SSE2Neon not found; fetching from GitHub...
-- Resolved SSE2Neon_SOURCE_DIR -> /Users/tarik/External/python/kimodo/MotionCorrection/build/temp.macosx-26.0-arm64-cpython-313/_deps/sse2neon-src
-- Adding SSE2Neon include dir: /Users/tarik/External/python/kimodo/MotionCorrection/build/temp.macosx-26.0-arm64-cpython-313/_deps/sse2neon-src
-- Configuring done (24.5s)
-- Generating done (0.1s)
CMake Warning:
  Manually-specified variables were not used by the project:

    Python3_EXECUTABLE


-- Build files have been written to: /Users/tarik/External/python/kimodo/MotionCorrection/build/temp.macosx-26.0-arm64-cpython-313
[  0%] Building CXX object CMakeFiles/motion_correction_cpp_base.dir/src/cpp/Math/Types.cpp.o
[  0%] Building CXX object CMakeFiles/motion_correction_cpp_base.dir/src/cpp/Math/Quaternion.cpp.o
[ 28%] Building CXX object CMakeFiles/motion_correction_cpp_base.dir/src/cpp/Math/Matrix.cpp.o
[ 28%] Building CXX object CMakeFiles/motion_correction_cpp_base.dir/src/cpp/Math/Transform.cpp.o
[ 42%] Building CXX object CMakeFiles/motion_correction_cpp_base.dir/src/cpp/Math/Vector.cpp.o
[ 57%] Building CXX object CMakeFiles/motion_correction_cpp_base.dir/src/cpp/AnimProcessing/InverseKinematics.cpp.o
[ 57%] Building CXX object CMakeFiles/motion_correction_cpp_base.dir/src/cpp/AnimProcessing/TrajectoryCorrector.cpp.o
[ 71%] Building CXX object CMakeFiles/motion_correction_cpp_base.dir/src/cpp/AnimProcessing/Utility.cpp.o
[ 85%] Linking CXX static library libmotion_correction_cpp_base.a
[ 85%] Built target motion_correction_cpp_base
[ 85%] Building CXX object CMakeFiles/_motion_correction.dir/src/cpp/BindingsPython.cpp.o
[100%] Linking CXX shared module /Users/tarik/External/python/kimodo/MotionCorrection/build/lib.macosx-26.0-arm64-cpython-313/motion_correction/_motion_correction.cpython-313-darwin.so
[100%] Built target _motion_correction
/Users/tarik/External/python/kimodo/.venv/lib/python3.13/site-packages/setuptools/_distutils/cmd.py:90: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        This deprecation is overdue, please update your project and remove deprecated
        calls to avoid build errors in the future.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
installing to build/bdist.macosx-26.0-arm64/wheel
running install
running install_lib
creating build/bdist.macosx-26.0-arm64/wheel
creating build/bdist.macosx-26.0-arm64/wheel/motion_correction
copying build/lib.macosx-26.0-arm64-cpython-313/motion_correction/_motion_correction.cpython-313-darwin.so -> build/bdist.macosx-26.0-arm64/wheel/./motion_correction
copying build/lib.macosx-26.0-arm64-cpython-313/motion_correction/__init__.py -> build/bdist.macosx-26.0-arm64/wheel/./motion_correction
copying build/lib.macosx-26.0-arm64-cpython-313/motion_correction/motion_postprocess.py -> build/bdist.macosx-26.0-arm64/wheel/./motion_correction
running install_egg_info
running egg_info
writing python/motion_correction.egg-info/PKG-INFO
writing dependency_links to python/motion_correction.egg-info/dependency_links.txt
writing requirements to python/motion_correction.egg-info/requires.txt
writing top-level names to python/motion_correction.egg-info/top_level.txt
reading manifest file 'python/motion_correction.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'test_example.py'
warning: no files found matching '*.dll' under directory 'python'
writing manifest file 'python/motion_correction.egg-info/SOURCES.txt'
Copying python/motion_correction.egg-info to build/bdist.macosx-26.0-arm64/wheel/./motion_correction-1.0.0-py3.13.egg-info
running install_scripts
creating build/bdist.macosx-26.0-arm64/wheel/motion_correction-1.0.0.dist-info/WHEEL
creating 'dist/motion_correction-1.0.0-cp313-cp313-macosx_26_0_arm64.whl' and adding 'build/bdist.macosx-26.0-arm64/wheel' to it
adding 'motion_correction/__init__.py'
adding 'motion_correction/_motion_correction.cpython-313-darwin.so'
adding 'motion_correction/motion_postprocess.py'
adding 'motion_correction-1.0.0.dist-info/METADATA'
adding 'motion_correction-1.0.0.dist-info/WHEEL'
adding 'motion_correction-1.0.0.dist-info/top_level.txt'
adding 'motion_correction-1.0.0.dist-info/RECORD'
removing build/bdist.macosx-26.0-arm64/wheel

2. Motion correction package install

$ python -m pip install dist/motion_correction-1.0.0-cp313-cp313-macosx_26_0_arm64.whl

Which platforms are used for testing?

  • Mac Mini M1
  • Macbook Pro M3 Pro

@Aero-Ex Aero-Ex merged commit b9c286b into Aero-Ex:main Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants